
<%@ tag language="java" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ attribute name="id" required="true" type="java.lang.String"
	description="id。"%>

<%@ attribute name="imgName" required="true" type="java.lang.String"
	description="name。"%>
<%@ attribute name="imgSrc" required="true" type="java.lang.String"
	description="imgSrc。"%>
<%@ attribute name="cutType" required="true" type="java.lang.String"
	description=" 1表示切图，2表示使用缩略图，0表示不做任何处理"%>
<%@ attribute name="imgWidth" required="true" type="java.lang.String"
	description="imgWidth。"%>
<%@ attribute name="imgHeight" required="true" type="java.lang.String"
	description="imgHeight。"%>
<%@ attribute name="imgPath" required="false" type="java.lang.String"
	description="imgPath。"%>
<%@ attribute name="imgFormat" required="false" type="java.lang.String"
	description="imgFormat。"%>
<%@ attribute name="showDescription" required="false"
	type="java.lang.Boolean" description="showDescription。"%>
<%@ attribute name="showEditBtn" required="false"
	type="java.lang.Boolean" description="showDescription。"%>
	
<c:set var="showEditBtn"
	value="${showEditBtn eq false?false: true}"></c:set>
<div class="avatar" style="width:${imgWidth+10 }px;margin:0 auto">
	<input id="${id }" type="hidden" name="${imgName }" value="${imgSrc }">
	<c:choose>
		<c:when test="${empty imgSrc }">
			<img id="img${id }" name="${imgName }"
				style="width:${imgWidth }px;height:${imgHeight}px;margin: auto;"
				src="img/elements/profile/avatar.png">
		</c:when>
		<c:otherwise>
			<img id="img${id }" name="${imgName }" src="imgSrc?path=${imgSrc }"
				style="width:${imgWidth }px;height:${imgHeight}px;margin: auto;"
				onclick="isperp.alert('<img src=\'${imgSrc  }\'>',{noIcon:true})">
		</c:otherwise>
	</c:choose>
	<c:if test="${showEditBtn  eq true }">
	<a style="width:${imgWidth+5 }px"
		href="javascript:isperp.openDialog({id:'${id }photoDialog',onThisWindow:true,windowSize:'normal', contentUrl:'tags/uploader/photoEdit?imgWidth=${imgWidth }&imgHeight=${imgHeight }&cutType=${cutType }&imgSrc=${imgSrc  }&imgPath=${imgPath }'});">修改</a>
    </c:if>
</div>
<c:set var="showDescription"
	value="${showDescription eq true?true: false}"></c:set>
<c:if test="${showDescription  eq true }">
	<span><font color="blue">（图片大小：${imgWidth }×${imgHeight}，格式：${imgFormat }）</font> </span>
</c:if>
<script type="text/javascript">
function ${id }photoDialogsetImage(src){ 
 	$("#img${id}").attr("src","imgSrc?path="+src+"&r="+Math.random());
 	$("#${id}").val(src);
 	isperp.closeDialog({onThisWindow:true,id:"${id }photoDialog"});
}
</script>



